//@author A0101119Y
#ifndef GOOGLEREQUESTAGENT_H
#define GOOGLEREQUESTAGENT_H

#include "Poco/Net/HTTPClientSession.h"
#include "Poco/Net/HTTPSClientSession.h"
#include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Util/Application.h"
#include "Poco/StreamCopier.h"
#include "Poco/Path.h"
#include "Poco/URI.h"
#include "Poco/Exception.h"
#include <sstream>
#include <string>
#include <vector>

namespace Twentyfifth {
	class GoogleRequestAgent : public Poco::Util::Application {
	protected:
	public:
		static const std::string METHOD_POST;
		static const std::string METHOD_GET;
		static const std::string METHOD_PUT;
		static const std::string METHOD_DELETE;
		static const std::string METHOD_PATCH;
		Poco::URI uri;
		Poco::Net::HTTPSClientSession httpsSession;
		Poco::Net::HTTPRequest request;
		Poco::Net::HTTPResponse response;
		std::string requestContent;
		std::string requestMethod;
		int responseCode;
		std::string responseContent;
		std::string responseReason;
	public:
		GoogleRequestAgent();
		void initSession();
		void sendRequest();
		void setURI(std::string);
		void setResponseCode(Poco::Net::HTTPResponse::HTTPStatus responseCode);
		void setRequestMethod(std::string requestMethod);
		void setRequestContent(std::string requestContent);
		void setResponseContent(std::string responseContent);
		void setResponseReason(std::string responseReason);
		std::string getURI();
		int getResponseCode();
		std::string getRequestMethod();
		std::string getRequestContent();
		std::string getResponseContent();
		std::string getResponseReason();
	};
}

#endif